<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>axipcie: xaxipcie_ep_cdma_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">axipcie
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaxipcie__ep__cdma__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xaxipcie_ep_cdma_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example for using AXI PCIe IP and its driver. </p>
<p>The example handles AXI PCIe IP when it is configured as an end point. It shows how to transfer data between system memory and end point memory. The user has to enter both addresses for source and destination. One of the addresses should be in system memory and the other one in the memory local to an end point(mapped to memory space of the system).</p>
<p>This example assumes that there is an AXI CDMA IP in the system. The user has to specify the Source, Destination and the Length of the DMA transfer which are valid for this system and are defined AXICDMA_SRC_ADDR, AXICDMA_DEST_ADDR and AXICDMA_LENGTH respectively in this example.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This code will illustrate how the AXI Pcie IP and its standalone driver can be used to:</p>
<ul>
<li>Initialize a PCIe bridge core built as an end point</li>
<li>Retrieve root complex configuration assigned to end point</li>
<li>Move data form system memory to end point memory using AXICDMA IP.</li>
</ul>
<p>We tried to use as much of the driver's API calls as possible to show the reader how each call could be used and that probably made the example not the shortest way of doing the tasks shown as they could be done.</p>
<pre>
  MODIFICATION HISTORY:</pre><pre>  Ver   Who  Date     Changes
</p>
<hr/>
<p>
  1.00a rkv  03/07/11 Initial version based on PLB PCIE example
  2.00a nm   10/19/11 Renamed function call XAxiPcie_GetRequestId to
                      XAxiPcie_GetRequesterId
  3.1   ms   01/23/17 Added xil_printf statement in main function to
                      ensure that "Successfully ran" and "Failed" strings
                      are available in all examples. This is a fix for
                      CR-965028.
        ms   04/05/17 Added tabspace for return statements in functions
                      for proper documentation while generating doxygen.
*</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0305d38f6ee9ba0d3e2e545b96201ce3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipcie__ep__cdma__example_8c.html#a0305d38f6ee9ba0d3e2e545b96201ce3">PCIeEndPointInitialize</a> (<a class="el" href="struct_x_axi_pcie.html">XAxiPcie</a> *XlnxEndPointPtr, u16 DeviceId)</td></tr>
<tr class="memdesc:a0305d38f6ee9ba0d3e2e545b96201ce3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This initialize an IP built as an end point.  <a href="#a0305d38f6ee9ba0d3e2e545b96201ce3">More...</a><br/></td></tr>
<tr class="separator:a0305d38f6ee9ba0d3e2e545b96201ce3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa948ae443a3c8a8bfd08560dd1a0c199"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipcie__ep__cdma__example_8c.html#aa948ae443a3c8a8bfd08560dd1a0c199">DmaDataTransfer</a> (u16 DeviceID)</td></tr>
<tr class="memdesc:aa948ae443a3c8a8bfd08560dd1a0c199"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function transfers data from Source Address to Destination Address using the AXI CDMA.  <a href="#aa948ae443a3c8a8bfd08560dd1a0c199">More...</a><br/></td></tr>
<tr class="separator:aa948ae443a3c8a8bfd08560dd1a0c199"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipcie__ep__cdma__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the entry point for AXI PCIe End Point with AXI CDMA Example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aa948ae443a3c8a8bfd08560dd1a0c199"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int DmaDataTransfer </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceID</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function transfers data from Source Address to Destination Address using the AXI CDMA. </p>
<p>User has to specify the Source Address, Destination Address and Transfer Length in AXICDMA_SRC_ADDR, AXICDMA_DEST_ADDR and AXICDMA_LENGTH defines respectively.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is device ID of the XAxiCdma Device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE.if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the hardware system is not built correctly, this function may never return to the caller.</dd></dl>
<p>User has to specify the Source Address, Destination Address and Transfer Length in AXICDMA_SRC_ADDR, AXICDMA_DEST_ADDR and AXICDMA_LENGTH defines respectively.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is device ID of the XAxiCdma Device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE.if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the hardware system is not built correctly this function may never return to the caller. </dd></dl>

<p>Referenced by <a class="el" href="xaxipcie__ep__cdma__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the entry point for AXI PCIe End Point with AXI CDMA Example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if unsuccessful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xaxipcie__ep__cdma__example_8c.html#aa948ae443a3c8a8bfd08560dd1a0c199">DmaDataTransfer()</a>, and <a class="el" href="xaxipcie__ep__cdma__example_8c.html#a0305d38f6ee9ba0d3e2e545b96201ce3">PCIeEndPointInitialize()</a>.</p>

</div>
</div>
<a class="anchor" id="a0305d38f6ee9ba0d3e2e545b96201ce3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int PCIeEndPointInitialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_pcie.html">XAxiPcie</a> *&#160;</td>
          <td class="paramname"><em>XlnxEndPointPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This initialize an IP built as an end point. </p>
<p>This function initializes the AXI PCIE end point IP.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">XlnxEndPointPtr</td><td>is a pointer to an instance of <a class="el" href="struct_x_axi_pcie.html" title="The XAxiPcie driver instance data. ">XAxiPcie</a> data structure represents an end point IP. </td></tr>
    <tr><td class="paramname">DeviceId</td><td>is PCIe IP unique ID</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if unsuccessful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">XlnxEndPointPtr</td><td>is a pointer to an instance of <a class="el" href="struct_x_axi_pcie.html" title="The XAxiPcie driver instance data. ">XAxiPcie</a> data structure represents an end point IP. </td></tr>
    <tr><td class="paramname">DeviceId</td><td>is AXI PCIe IP unique Device Id</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if unsuccessful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_axi_pcie___config.html#a98bdcba67cfa7c75179ae1b0b7b6415f">XAxiPcie_Config::BaseAddress</a>, <a class="el" href="group__axipcie.html#ga6eaa13c68af6eb2ca12ae556f9e0769b">XAxiPcie_CfgInitialize()</a>, <a class="el" href="group__axipcie.html#gabdf66d0cb481a5eea62e1f98e71d9520">XAxiPcie_ClearPendingInterrupts()</a>, <a class="el" href="group__axipcie.html#gae238cf115bd039e0f7228e385c893aad">XAxiPcie_DisableInterrupts()</a>, <a class="el" href="group__axipcie.html#gae118e9d7fd6b78ca0b8d4fd6694f9808">XAxiPcie_GetEnabledInterrupts()</a>, <a class="el" href="group__axipcie.html#gaec39c65db1aeac38798a250a25298208">XAxiPcie_GetPendingInterrupts()</a>, <a class="el" href="group__axipcie.html#ga77063428b5641d07910419770813c148">XAxiPcie_GetRequesterId()</a>, <a class="el" href="group__axipcie.html#gaeb7c330e5d10623ceafc66dd08f149ea">XAXIPCIE_ID_CLEAR_ALL_MASK</a>, <a class="el" href="group__axipcie.html#ga40d5e3c669642af8441aed4d5ad23ee2">XAXIPCIE_IM_ENABLE_ALL_MASK</a>, <a class="el" href="group__axipcie.html#ga08e3f639ed3ca042d429630fec260654">XAxiPcie_IsLinkUp</a>, <a class="el" href="group__axipcie.html#ga911e4cd0c119271f6c01c9b1ac827df1">XAxiPcie_LookupConfig()</a>, and <a class="el" href="group__axipcie.html#gad9494095b9350f455af9e7da5375d522">XAxiPcie_ReadLocalConfigSpace()</a>.</p>

<p>Referenced by <a class="el" href="xaxipcie__ep__cdma__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
